home *** CD-ROM | disk | FTP | other *** search
- <?xml version="1.0" encoding="UTF-8" standalone="no"?>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
- <title>14.4.  Slice</title>
- <link rel="stylesheet" href="gimp-help-plain.css" type="text/css" />
- <link rel="stylesheet" href="gimp-help-screen.css" type="text/css" />
- <link rel="stylesheet" href="gimp-help-custom.css" type="text/css" />
- <link rel="alternate stylesheet" href="gimp22.css" type="text/css" title="gimp22" />
- <meta name="generator" content="DocBook XSL Stylesheets V1.73.2" />
- <link rel="start" href="index.html" title="GNU Image Manipulation Program" />
- <link rel="up" href="filters-web.html" title="14.  Web Filters" />
- <link rel="prev" href="plug-in-semiflatten.html" title="14.3.  Semi-Flatten" />
- <link rel="next" href="filters-alpha-to-logo.html" title="15.  Alpha to Logo Filters" />
- </head>
- <body>
- <div class="navheader">
- <table width="100%" summary="Navigation header">
- <tr>
- <th colspan="3" align="center">14.4. 
- <span lang="en" xml:lang="en">Slice</span>
- </th>
- </tr>
- <tr>
- <td width="20%" align="left"><a accesskey="p" href="plug-in-semiflatten.html"><img src="../images/prev.png" alt="Prev" /></a> </td>
- <th width="60%" align="center">14. 
- <span lang="en" xml:lang="en">Web Filters</span>
- </th>
- <td width="20%" align="right"> <a accesskey="n" href="filters-alpha-to-logo.html"><img src="../images/next.png" alt="Next" /></a></td>
- </tr>
- </table>
- <hr />
- </div>
- <div class="sect2" lang="en" xml:lang="en">
- <div class="titlepage">
- <div>
- <div>
- <h3 class="title"><a id="python-fu-slice"></a>14.4. 
- <span lang="en" xml:lang="en">Slice</span>
- </h3>
- </div>
- <div>
- <div class="revhistory">
- <table border="1" width="100%" summary="Revision history">
- <tr>
- <th align="left" valign="top" colspan="3">
- <b>Revision History</b>
- </th>
- </tr>
- <tr>
- <td align="left">Revision $Revision: 2442 $</td>
- <td align="left">2008-04-05</td>
- <td align="left">ude</td>
- </tr>
- </table>
- </div>
- </div>
- </div>
- </div>
- <a id="id2781484" class="indexterm"></a>
- <a id="id2781502" class="indexterm"></a>
- <div class="sect3" lang="en" xml:lang="en">
- <div class="titlepage">
- <div>
- <div>
- <h4 class="title"><a id="id2781511"></a>14.4.1. 
- <span lang="en" xml:lang="en">Overview</span>
- </h4>
- </div>
- </div>
- </div>
- <div class="figure">
- <a id="id2781521"></a>
- <p class="title">
- <b>Figure 16.290. 
- <span lang="en" xml:lang="en">
- Example for the “<span class="quote">Slice</span>” filter
- </span>
- </b>
- </p>
- <div class="figure-contents">
- <div class="mediaobject">
- <img src="../images/filters/examples/taj_guides.jpg" alt="Example for the Slice filter" />
- <div class="caption">
- <p>Original image with guides</p>
- </div>
- </div>
- <div class="mediaobject">
- <img src="../images/filters/examples/web-taj-slice.jpg" alt="Example for the Slice filter" />
- <div class="caption">
- <p>“<span class="quote">Slice</span>” applied</p>
- </div>
- </div>
- </div>
- </div>
- <br class="figure-break" />
- <p>
- This filter is a simple and easy to use helper for creating sensitive
- images to be used in HTML files. The filter slices up the source image
- (like the <a class="link" href="plug-in-guillotine.html" title="9.10.  Guillotine">Guillotine</a> command
- does) along its horizontal and vertical guides, and produces a set of
- sub-images. At the same time it creates a piece of HTML code for a table
- saved in a text file. Every table cell contains one part of the image.
- The text file should then be embedded in an HTML document.
- </p>
- <p>
- Note that this filter is really a very simple helper. A typical HTML
- code produced by the filter may be not much more than this:
- </p>
- <div class="example">
- <a id="id2781615"></a>
- <p class="title">
- <b>Example 16.1. 
- <span lang="en" xml:lang="en">
- Simple “<span class="quote">Slice</span>” filter example output
- </span>
- </b>
- </p>
- <div class="example-contents">
- <pre class="programlisting">
- <table cellpadding="0" border="0" cellspacing="0">
- <tr>
- <td><img alt="" src="slice_0_0.png"/></td>
- <td><img alt="" src="slice_0_1.png"/></td>
- </tr>
- <tr>
- <td><img alt="" src="slice_1_0.png"/></td>
- <td><img alt="" src="slice_1_1.png"/></td>
- </tr>
- </table>
- </pre>
- <p>
- Produced HTML code; the “<span class="quote">style</span>” attribute has been
- omitted.
- </p>
- </div>
- </div>
- <br class="example-break" />
- <p>
- When there are no guides in the image, the filter will no nothing. If,
- however, the guides are just hidden, the filter will work.
- </p>
- <div class="tip" style="margin-left: 0.5in; margin-right: 0.5in;">
- <table border="0" summary="Tip">
- <tr>
- <td rowspan="2" align="center" valign="top" width="25">
- <img alt="[Tip]" src="../images/tip.png" />
- </td>
- <th align="left">Tip</th>
- </tr>
- <tr>
- <td align="left" valign="top">
- <p>
- The <a class="link" href="plug-in-imagemap.html" title="14.2.  ImageMap">ImageMap</a> filter is a much
- more powerful and sophisticated tool for creating sensitive images.
- (But it is also much more complex...)
- </p>
- </td>
- </tr>
- </table>
- </div>
- </div>
- <div class="sect3" lang="en" xml:lang="en">
- <div class="titlepage">
- <div>
- <div>
- <h4 class="title"><a id="id2781682"></a>14.4.2. 
- <span lang="en" xml:lang="en">Activate the filter</span>
- </h4>
- </div>
- </div>
- </div>
- <p>
- This filter is found in the image window menu under
- <span class="guimenu"><span class="accel">F</span>ilters</span> ‚Üí <span class="guisubmenu"><span class="accel">W</span>eb</span> ‚Üí <span class="guimenuitem"><span class="accel"></span>Slice</span>.
- </p>
- </div>
- <div class="sect3" lang="en" xml:lang="en">
- <div class="titlepage">
- <div>
- <div>
- <h4 class="title"><a id="id2781728"></a>14.4.3. 
- <span lang="en" xml:lang="en">Options</span>
- </h4>
- </div>
- </div>
- </div>
- <div class="figure">
- <a id="id2781739"></a>
- <p class="title">
- <b>Figure 16.291. 
- <span lang="en" xml:lang="en">“<span class="quote">Slice</span>” options</span>
- </b>
- </p>
- <div class="figure-contents">
- <div class="mediaobject">
- <img src="../images/filters/options-web-slice.png" alt="Slice options" />
- </div>
- </div>
- </div>
- <br class="figure-break" />
- <div class="variablelist">
- <p>
- Most options are self-explanatory, but nevertheless:
- </p>
- <dl>
- <dt>
- <span class="term">
- <span lang="en" xml:lang="en">Path for HTML export</span>
- </span>
- </dt>
- <dd>
- <p>
- Where the HTML file and the image files will be saved. By default
- these files will be stored in the current working directory.
- Clicking on the buttom to the right opens a pull-down menu, where
- you can select a different location.
- </p>
- </dd>
- <dt>
- <span class="term">
- <span lang="en" xml:lang="en">Filename for export</span>
- </span>
- </dt>
- <dd>
- <p>
- The name of the HTML file. You can change the filename using the
- textbox.
- </p>
- </dd>
- <dt>
- <span class="term">
- <span lang="en" xml:lang="en">Image name prefix</span>
- </span>
- </dt>
- <dd>
- <p>
- The name of an image file produced by this filter is
- <code class="filename">prefix_i_k.ext</code>, where
- <code class="filename">prefix</code> is that part of the filename which you
- can freely select using the textbox to the right, by default:
- <code class="filename">slice</code>.
- (<code class="filename">i</code> and <code class="filename">k</code> are the numbers
- of the row and the column, each starting with 0;
- <code class="filename">.ext</code> is the filename
- extension depending on the selected
- <span class="guilabel">Image format</span>.)
- </p>
- <p>
- This option is particularly useful when you want to create
- <span class="guilabel">Javascript for onmouseover and clicked</span> and
- need different sets of images.
- </p>
- </dd>
- <dt>
- <span class="term">
- <span lang="en" xml:lang="en">Image format</span>
- <span lang="en" xml:lang="en">Format de l'Image</span>
- </span>
- </dt>
- <dd>
- <p>
- You can choose to create image files in the
- <a class="link" href="glossary.html#glossary-gif" title="GIF">GIF</a>,
- <a class="link" href="glossary.html#glossary-jpeg" title="JPEG">JPG</a>, or
- <a class="link" href="glossary.html#glossary-png" title="PNG">PNG</a>
- <a class="link" href="glossary.html#glossary-fileformat" title="File Format">file format</a>.
- </p>
- </dd>
- <dt>
- <span class="term">
- <span lang="en" xml:lang="en">
- Separate image folder; Folder for image export
- </span>
- </span>
- </dt>
- <dd>
- <p>
- When <span class="guilabel">Separate image folder</span> is enabled, a
- folder will be created where the image files will be placed. By
- default, the name of this destination folder is
- <code class="filename">images</code>, but you can change
- it in the <span class="guilabel">Folder for image export</span> textbox.
- </p>
- <div class="example">
- <a id="id2782016"></a>
- <p class="title">
- <b>Example 16.2. 
- <span lang="en" xml:lang="en">With separate image folder</span>
- </b>
- </p>
- <div class="example-contents">
- <div class="mediaobject">
- <img src="../images/filters/examples/slice-folder.png" />
- <div class="caption">
- <p>
- Result of enabled “<span class="quote">Separate image folder</span>”
- </p>
- </div>
- </div>
- </div>
- </div>
- <br class="example-break" />
- </dd>
- <dt>
- <span class="term">
- <span lang="en" xml:lang="en">Space between table elements</span>
- </span>
- </dt>
- <dd>
- <p>
- This value (0-15) will be passed as “<span class="quote">cellspacing</span>”
- attribute to the HTML table. The result is, that horizontal and
- vertical guides will be replaced with stripes of the specified
- width:
- </p>
- <div class="example">
- <a id="id2782082"></a>
- <p class="title">
- <b>Example 16.3. 
- <span lang="en" xml:lang="en">Space between table elements</span>
- </b>
- </p>
- <div class="example-contents">
- <div class="mediaobject">
- <img src="../images/filters/examples/slice-cellspacing.png" />
- <div class="caption">
- <p>Corresponding HTML code snippet</p>
- </div>
- </div>
- </div>
- </div>
- <br class="example-break" />
- <p>
- Note that the image will not be enlarged by the size of these
- stripes. Instead, the resulting HTML image will look like you have
- drawn the stripes with the Eraser tool.
- </p>
- </dd>
- <dt>
- <span class="term">
- <span lang="en" xml:lang="en">Javascript for onmouseover and clicked</span>
- </span>
- </dt>
- <dd>
- <p>
- When this option is enabled, the filter will also add some
- JavaScript code. Like the HTML code, this code does not work as
- is, rather it's a good starting point for adding some dynamic
- functionality. The JavaScript code provides a function to handle
- events like “<span class="quote">onmouseover</span>”:
- </p>
- <div class="example">
- <a id="id2782156"></a>
- <p class="title">
- <b>Example 16.4. 
- <span lang="en" xml:lang="en">JavaScript code snippet</span>
- </b>
- </p>
- <div class="example-contents">
- <pre class="programlisting">
- function exchange (image, images_array_name, event)
- {
- name = image.name;
- images = eval (images_array_name);
- switch (event)
- {
- case 0:
- image.src = images[name + "_plain"].src;
- break;
- case 1:
- image.src = images[name + "_hover"].src;
- break;
- case 2:
- image.src = images[name + "_clicked"].src;
- break;
- case 3:
- image.src = images[name + "_hover"].src;
- break;
- }
- }
- </pre>
- </div>
- </div>
- <br class="example-break" />
- </dd>
- <dt>
- <span class="term">
- <span lang="en" xml:lang="en">Skip animation for table caps</span>
- </span>
- </dt>
- <dd>
- <p>
- When disabled, the filter will add a
- <code class="code"><a href="#"> ... </a></code>
- hyperlink stub to every table cell. When enabled (this is the
- default) and there are at least two horizontal or two vertical
- guides, the filter will not add a hyperlink stub to the first and
- last cell in a column or row. This may be useful when you have an
- image with border and you don't want to make the border sensitive.
- </p>
- <div class="example">
- <a id="id2782217"></a>
- <p class="title">
- <b>Example 16.5. 
- <span lang="en" xml:lang="en">
- Skipped animation for table caps (simplified HTML code)
- </span>
- </b>
- </p>
- <div class="example-contents">
- <pre class="programlisting">
- <table cellpadding="0" border="0" cellspacing="0">
- <tr>
- <td><img alt="" src="images/slice_0_0.png"/></td>
- <td><img alt="" src="images/slice_0_1.png"/></td>
- <td><img alt="" src="images/slice_0_2.png"/></td>
- <td><img alt="" src="images/slice_0_3.png"/></td>
- </tr>
- <tr>
- <td><img alt="" src="images/slice_1_0.png"/></td>
- <td><a href="#"><img alt="" src="images/slice_1_1.png"/></a></td>
- <td><a href="#"><img alt="" src="images/slice_1_2.png"/></a></td>
- <td><img alt="" src="images/slice_1_3.png"/></td>
- </tr>
- <tr>
- <td><img alt="" src="images/slice_2_0.png"/></td>
- <td><img alt="" src="images/slice_2_1.png"/></td>
- <td><img alt="" src="images/slice_2_2.png"/></td>
- <td><img alt="" src="images/slice_2_3.png"/></td>
- </tr>
- </table>
- </pre>
- <p>
- Only inner cells have (empty) hyperlinks.
- </p>
- </div>
- </div>
- <br class="example-break" />
- </dd>
- </dl>
- </div>
- </div>
- </div>
- <div class="navfooter">
- <hr />
- <table width="100%" summary="Navigation footer">
- <tr>
- <td width="40%" align="left"><a accesskey="p" href="plug-in-semiflatten.html"><img src="../images/prev.png" alt="Prev" /></a> </td>
- <td width="20%" align="center">
- <a accesskey="u" href="filters-web.html">
- <img src="../images/up.png" alt="Up" />
- </a>
- </td>
- <td width="40%" align="right"> <a accesskey="n" href="filters-alpha-to-logo.html"><img src="../images/next.png" alt="Next" /></a></td>
- </tr>
- <tr>
- <td width="40%" align="left" valign="top"><a accesskey="p" href="plug-in-semiflatten.html">14.3. 
- <span lang="en" xml:lang="en">Semi-Flatten</span>
- </a> </td>
- <td width="20%" align="center">
- <a accesskey="h" href="index.html">
- <img src="../images/home.png" alt="Home" />
- </a>
- </td>
- <td width="40%" align="right" valign="top"> <a accesskey="n" href="filters-alpha-to-logo.html">15. 
- <span lang="en" xml:lang="en">Alpha to Logo Filters</span>
- </a></td>
- </tr>
- </table>
- </div>
- </body>
- </html>
-